package com.zhxq.member.controller;

import com.zhxq.common.core.domain.AjaxResult;
import com.zhxq.member.domain.dto.UserLoginDto;
import com.zhxq.member.domain.dto.WxLoginDto;
import com.zhxq.member.service.IMemberService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/member")
@Tag(name = "客户管理")
@RequiredArgsConstructor
public class MemberUserController {

    private final IMemberService memberService;

    @PostMapping("/wx/login")
    @Operation(summary = "微信登录")
    public AjaxResult wxLogin(@RequestBody WxLoginDto wxLoginDto) {
        return memberService.wxLogin(wxLoginDto);
    }

    @PostMapping("/user/login")
    @Operation(summary = "用户登录")
    public AjaxResult userLogin(@RequestBody UserLoginDto userLoginDto) {
        return memberService.userLogin(userLoginDto);
    }
}
